package com.hspedu.Override_.Exercise;

public class Student extends Person {
    private String id;
    private double score;

    public Student(String name, int age, String id, double score) {
        super(name, age);
        setId(id);
        setScore(score);
    }

    //定义 say 方法(返回自我介绍)，这里利用了重写
    public String say(){
        return "大家好,我叫"+ getName() + "，今年" + getAge() + "岁了"
                + "\n我的学号:"+ id + "\n我的分数:" + score;
    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }
}
